//判断当前环境类型
const isProdEnv = process.env.NODE_ENV === 'production'
//开发环境下的配置参数 
        //develop
let HOST = "http://192.168.1.25:8604/manager-service/"; 
let PYTHON_HOST = "http://127.0.0.1:8000/";

        //develop2
// let HOST = "http://localhost:8080/agg-order-service-1.0-SNAPSHOT/";
// let SHOPPING_HOST = "http://192.168.1.249:8888/agg-shopping-service-1.0-SNAPSHOT/";
// let REFUND_HOST = "http://192.168.1.249:8888/agg-rerouting-service-1.0-SNAPSHOT/";
//登录用到的token
let XTOKEN = "eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiI0NDAwMDQzNDAzIiwiY3JlYXRlZCI6MTUwMTgxMDg0MDY3OH0.F-UhefPjia67vgphD_k9tbSITrXKJdRUVRhV_Uy8jv4oc7mP55Pob-KlWDj0WUsPu_rNtvMB1muWjyLDmMmEQw";

let secret = 'yixiangyunda2017';
// ms('2 days')  // 172800000
// ms('1d')      // 86400000
// ms('10h')     // 36000000
// ms('2.5 hrs') // 9000000
// ms('2h')      // 7200000
// ms('1m')      // 60000
// ms('5s')      // 5000
// ms('1y')      // 31557600000
// ms('100')     // 100
let TOKEN_EXP = '2h';//30m  2h 
//shopping URL Config 
let rms = {
    forecastList: HOST + "forecast/list",
    scheduleList: HOST + "schedule/list",
    classList: HOST + "class/list",
    optimizationList: HOST + "optimization/list"
}
let python = {
    simulation: PYTHON_HOST + "simulation"
}
let user = {
    create: HOST + "user/create",
    update: HOST + "user/update",
    list: HOST + "user/list",
    passwordReset: HOST + "user/password/reset",
    roleCreate: HOST + "user/role/create",
    roleUpdate: HOST + "user/role/update",
    roleList: HOST + "user/role/list",
    resourceCreate: HOST + "resource/create",
    resourceDelete: HOST + "resource/delete",
    resourceUpdate: HOST + "resource/update",
    resourceFind: HOST + "resource/find",
    resourceList: HOST + "resource/list",
    resourceListMenu: HOST + "resource/list/menu"
}
//生产环境下的配置参数
if (isProdEnv) { //覆盖开发环境的参数 
    HOST = "http://100.114.245.166:8060/agg-order-service-1.0-SNAPSHOT/";
    SHOPPING_HOST = "http://100.114.245.166:8060/agg-shopping-service-1.0-SNAPSHOT/";
    REFUND_HOST = "http://100.114.245.166:8060/agg-rerouting-service-1.0-SNAPSHOT/";
    XTOKEN = "";
    user = {
        logintest: HOST + "admin/test",
        login: HOST + "lkl/index"
    }
    shopping = {
        query: SHOPPING_HOST + "flight/search",
        confirm: SHOPPING_HOST + 'flight/price'
    }
    passenger = {
        query: HOST + "commonPass/page",
        create: HOST + "commonPass/create",
        update: HOST + "commonPass/update",
    }
    insurance = {
        query: HOST + "insurantConf/list",
        detail: HOST + "insurantConf/detail/",
        insureOrders: HOST + "order/queryInsureOrders/"
    }
    order = {
        query: HOST + "search/bigList",
        create: HOST + "order/create",
        createRT: HOST + "order/createRT",
        cancel: HOST + "order/appcancel"
    }
    pay = {
        pre: HOST + "pay/pre",
        endorsePre: HOST + "pay/endorsePre"
    }
    activity = {
        query: HOST + "activity/page",
        create: HOST + "activity/create",
        update: HOST + "activity/update",
    }
    refundendorse = {
        rule: REFUND_HOST + "orderChangeBack/endorsementSearch"
    }
}
//模块导出 
export let url = {
    token:XTOKEN,
    secret:secret,
    TOKEN_EXP:TOKEN_EXP,
    rms: rms,
    user: user,
    python: python
};